.pragma library

/**
  XML to use in a post for sharing linkedin shares
  https://developer.linkedin.com/documents/share-api
  */
function generate_share(comment, title, submittedUrl, submittedImageUrl) {

	var string = '<?xml version="1.0" encoding="UTF-8"?>\
	<share>\
	  <comment>'+comment+'</comment>\
	  <content>\
		<title>'+(title || "")+'</title>\
		 <submitted-url>'+(submittedUrl || "")+'</submitted-url>\
		 <submitted-image-url>'+(submittedImageUrl || "")+'</submitted-image-url>\
	  </content>\
	  <visibility>\
		 <code>anyone</code>\
	  </visibility>\
	</share>';
	return string;
}

/**
  XMl to use in a post for sending messages to members
  https://developer.linkedin.com/documents/messaging-between-connections-api
  */
function generate_message(recipientID, subject, body) {

	var string = "<?xml version='1.0' encoding='UTF-8'?>\
	<mailbox-item>\
	  <recipients>\
		<recipient>\
			<person path='/people/"+(recipientID || "")+"'/>\
		</recipient>\
	  </recipients>\
	  <subject>"+(subject || "")+"</subject>\
	  <body>"+(body || "")+"</body>\
	</mailbox-item>";
	return string;
}
